package pl.agh.pp.zephyr.utils;

import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * Ułatwia zarządzanie przepływem komunikatów
 * */
public abstract class LogPublisher {

	protected final Logger log;

	protected LogPublisher(Class<?> c) {
		log = Logger.getLogger(c.getSimpleName());
		log.setLevel(Level.CONFIG);
	}

	public void addHandler(Handler handler) throws SecurityException {
		log.addHandler(handler);
	}

	public void removeHandler(Handler handler) throws SecurityException {
		log.removeHandler(handler);
	}
	
}
